package com.gitee.wsl.collections.list

import com.gitee.wsl.ext.base.println
import com.gitee.wsl.ext.collection.println
import com.gitee.wsl.ext.list.l
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue


class LazyArrayListTest {
    @Test
    fun test(){
        val a1=LazyArrayList<Int>(10)
        a1[2]=5
        a1[5]=16
        a1[6]=a1[2]
        assertFalse(a1.checkValue())
        //assertThrows(NullPointerException::class.java){a1.toIntArray()}
        a1.toArray().println()

        val a2=LazyArrayList<Float>(1)
        a2[0]=100f
        assertTrue(a2.checkValue())
        val floatArray=a2.toFloatArray()
        floatArray.println()

        val l= l(1,2,1,4)
        l.println()

        val lazy2Array = lazyArray2<Float>(1)
        lazy2Array[0]=a2
        println(lazy2Array[0][0])

    }

}